import jsonpath

data = {
   "errcode": 0,
   "errmsg": "ok",
   "department_id": [
       {
           "id": 2,
           "parentid": 1,
           "order": 10
       },
       {
           "id": 3,
		   "parentid": 2,
           "order": 40
       },

   ]
}

result = jsonpath.jsonpath(data, "$..id")
print(result)